<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_quiz_question".
 *
 * @property string $id 主键
 * @property string $pid 父id
 * @property string $title 名称
 * @property string $content 内容
 * @property string $is_leaf 是否叶子节点
 * @property string $type 类型（单选/多选）
 * @property string $difficulty 难度
 * @property string $status 状态
 * @property int $score 分值
 * @property string $code 编码
 * @property string $keyword 关键字
 * @property string $comment 注释
 * @property string $copyright 版权
 * @property string $group_id 所属资源组
 * @property string $major_id 专业id
 * @property string $create_by 创建者
 * @property string $create_time 创建时间
 * @property string $update_by 更新者
 * @property string $update_time 更新时间
 * @property int $del_flag 删除标示
 * @property string $answ_note 答案解析
 * @property int    $old_id 3.0迁移习题id
 */
class TQuizQuestion extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_quiz_question';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'content', 'type', 'del_flag'], 'required'],
            [['title', 'content', 'comment', 'answ_note'], 'string'],
            [['score', 'del_flag'], 'integer'],
            [['create_time', 'update_time'], 'safe'],
            [['id', 'pid', 'group_id', 'major_id', 'create_by', 'update_by'], 'string', 'max' => 36],
            [['is_leaf', 'type', 'difficulty', 'status', 'code'], 'string', 'max' => 64],
            [['keyword', 'copyright'], 'string', 'max' => 255],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'pid' => 'Pid',
            'title' => 'Title',
            'content' => 'Content',
            'is_leaf' => 'Is Leaf',
            'type' => 'Type',
            'difficulty' => 'Difficulty',
            'status' => 'Status',
            'score' => 'Score',
            'code' => 'Code',
            'keyword' => 'Keyword',
            'comment' => 'Comment',
            'copyright' => 'Copyright',
            'group_id' => 'Group ID',
            'major_id' => 'Major ID',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => 'Del Flag',
            'answ_note' => 'Answ Note',
            'old_id' => 'Old Id',
        ];
    }
}
